package com.mall.ware.dao;

import com.mall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author yjc
 * @email 111111@163.com
 * @date 2024-08-04 10:28:13
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void addStock(@Param("skuNum") Integer skuNum, @Param("wareId") Long wareId, @Param("skuId") Long skuId);

    Long getSkuStock(Long skuId);

    List<WareSkuEntity> listHasStock(@Param("skuId") Long skuId);

    Integer lockSkuStack(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);
}
